<template>
	<view class="app">
		<jnavbar :title="'文章详情'"></jnavbar>
		<view class="uni-flex-column">
			<text class="title">{{detail.title}}</text>
			<!-- <u-line color="#5e5e5e" margin="0 0 20rpx 0"></u-line> -->
			<text class="time">{{detail.create_time}}</text>
		</view>
		<u-parse :tag-style="style" :domain="baseUrl" :html="detail.content" :show-with-animation="true"></u-parse>
		<vfooter></vfooter>
	</view>
</template>

<script>
import base from '@/common/baseUrl.js';
import {mapState, mapMutations} from 'vuex';
export default {
	data() {
		return {
			baseUrl: base.baseUrl,
			detail:{},
			style: {
				// 字符串的形式
				p: 'word-wrap : break-word'
			}
		};
	},
	async onLoad(e) {
		await this.$getWx
		this.id = e.id;
		this.getarticle();
	},
	computed: {
	
		baseUrl(){
			return util.geturl(base.baseUrl)
		},
		...mapState({
			oss: state => state.oss
		})
	},
	methods: {
		getarticle() {
			this.$http('/article/' + this.id, {}, 'GET').then(res => {
				this.detail = res.data.msg;
			});
		}
	}
};
</script>

<style>
.app {
	background: #fff;
	padding: 0 40rpx;
}
.title{
	    font-size: 40rpx;
	    padding: 20rpx 0;
	    font-family: 'PingFangSC-Medium';
	    color: #222;
	
	    letter-spacing: 0;
	    font-weight: 800;
}
.time{
	color: #8b8b8b;
	margin-bottom: 20rpx;
}
</style>
